package com.gupaoedu.design.strategy.task;

import java.util.Date;

/**
 * <p>汽车</p>
 *
 * @author Andy
 * @date 2018/3/13.
 */
public class Car {
    private String name;

    private double kilometre;

    private Date maintainDate;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getKilometre() {
        return kilometre;
    }

    public void setKilometre(double kilometre) {
        this.kilometre = kilometre;
    }

    public Date getMaintainDate() {
        return maintainDate;
    }

    public void setMaintainDate(Date maintainDate) {
        this.maintainDate = maintainDate;
    }

    public MaintainResult maintainCar(MaintainWay way) {
        return way.get().carMaintain(this);
    }

    @Override
    public String toString() {
        return "Car{" +
                "name='" + name + '\'' +
                ", kilometre=" + kilometre +
                ", maintainDate=" + maintainDate +
                '}';
    }
}
